# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=libp11
pkgver=0.4.12
pkgrel=0
pkgdesc="PKCS#11 wrapper library"
url="https://github.com/OpenSC/libp11/wiki"
arch="all !loongarch64"
license="LGPL-2.1-or-later"
makedepends="openssl-dev"
options="!check" # tests not working
checkdepends="opensc softhsm"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/OpenSC/libp11/releases/download/libp11-$pkgver/libp11-$pkgver.tar.gz
	libp11-0.4.12-openssl-3.patch
	Remove-unused-execinfo.h-include-from-tests.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}
sha512sums="
674cfca2c9eaf162262204c94f9d59d3095dabbc348c1842e758b897e1a5bd4ba08b2d589ec3b2a2d1343a8760eab253e7008dc09ef5b499e2f16385efe5c8cc  libp11-0.4.12.tar.gz
3344c082198135125ff018bbf9c84bb0c436109713877ad129b4cd0f521cacf10f77f8b0b5fcd2be9a7b4f0e66336e4830b350043fbab049846b39b58105cb92  libp11-0.4.12-openssl-3.patch
a77bd2663c4f802ea1f785a64eddebb5448c9484772ca5a0ed789348782f3f489a554f9dcdf2fe71f1c3ffb5d1fc1b5a8d3d9b2baeae711039a1fe8c42b5e0ce  Remove-unused-execinfo.h-include-from-tests.patch
"
